package com.tarena.lbs.activity.dao.repository.impl;

import com.tarena.lbs.activity.dao.mapper.ActivityMapper;
import com.tarena.lbs.activity.dao.repository.ActivityRepository;
import com.tarena.lbs.activity.pojo.po.ActivityPO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Slf4j
@Repository
public class ActivityRepositoryImpl implements ActivityRepository {
    @Autowired
    private ActivityMapper activityMapper;

    @Override
    public List<ActivityPO> getActivities(Integer businessId) {
        // 使用分页查询在Service层处理，这里返回全部（也可扩展分页方法）
        return null;
    }

    @Override
    public void save(ActivityPO poParam) {
        activityMapper.save(poParam);
    }

    @Override
    public ActivityPO getActivityById(Integer id) {
        return activityMapper.getDetailById(id);
    }

    @Override
    public List<ActivityPO> getActivitiesByStoreId(String storeId) {
        return activityMapper.getActivitiesByStoreId(storeId);
    }
}
